from json import load
import tkinter as tk
from PIL import Image, ImageTk
from UDP_receive import recv
from threading import Thread

root = tk.Tk()

root.title('屏幕广播接收')
root.geometry('800x600+0+0')

root.attributes('-topmost', True)

def load_img():
    global photo
    photo = recv()
    photo = photo.resize((800, 600))
    photo = ImageTk.PhotoImage(photo)

    #lbImage['image'] = photo
    tk.Label(root, image=photo).grid(row=0, column=0)


thread_show = Thread(target=load_img)
thread_show.daemon = True
thread_show.start()
root.mainloop()
